﻿@using Microsoft.AspNetCore.Identity
@using OnlineEducation.Models

@inject SignInManager<ApplicationUser> SignInManager
@inject UserManager<ApplicationUser> UserManager
@inject OnlineEducation.Data.ApplicationDbContext DbContext

@if (SignInManager.IsSignedIn(User))
{
    ApplicationUser appUser = await UserManager.GetUserAsync(User);

    <li class="d-none d-sm-block">
        <form class="app-search">
            <div class="app-search-box">
                <div class="input-group">
                    <input type="text" class="form-control" placeholder="Search...">
                    <div class="input-group-append">
                        <button class="btn" type="submit">
                            <i class="fe-search"></i>
                        </button>
                    </div>
                </div>
            </div>
        </form>
    </li>

    <li class="dropdown notification-list">
        <a class="nav-link dropdown-toggle  waves-effect waves-light" data-toggle="dropdown" href="layouts-preloader.html#" role="button" aria-haspopup="false" aria-expanded="false">
            <i class="fe-bell noti-icon"></i>
            <span class="badge badge-danger rounded-circle noti-icon-badge">0</span>
        </a>
        <!--<div class="dropdown-menu dropdown-menu-left dropdown-lg">-->

            <!-- item-->
            <!--<div class="dropdown-item noti-title">
                <h5 class="m-0">
                    <span class="float-right mr-1">
                        <a href="/" class="text-dark">
                            <small>清除全部</small>
                        </a>
                    </span>系统通知
                </h5>
            </div>

            <div class="slimscroll noti-scroll">-->

                <!-- item-->
                <!--<a href="javascript:void(0);" class="dropdown-item notify-item active">
                    <div class="notify-icon">
                        <img src="/assets/images/users/user-1.png" class="img-fluid rounded-circle" alt="" />
                    </div>
                    <p class="notify-details">Cristina Pride</p>
                    <p class="text-muted mb-0 user-msg">
                        <small>Hi, How are you? What about our next meeting</small>
                    </p>
                </a>-->

                <!-- item-->
                <!--<a href="javascript:void(0);" class="dropdown-item notify-item">
                    <div class="notify-icon bg-primary">
                        <i class="mdi mdi-comment-account-outline"></i>
                    </div>
                    <p class="notify-details">
                        Caleb Flakelar commented on Admin
                        <small class="text-muted">1 min ago</small>
                    </p>
                </a>-->

                <!-- item-->
                <!--<a href="javascript:void(0);" class="dropdown-item notify-item">
                    <div class="notify-icon">
                        <img src="/assets/images/users/user-4.jpg" class="img-fluid rounded-circle" alt="" />
                    </div>
                    <p class="notify-details">Karen Robinson</p>
                    <p class="text-muted mb-0 user-msg">
                        <small>Wow ! this admin looks good and awesome design</small>
                    </p>
                </a>-->

                <!-- item-->
                <!--<a href="javascript:void(0);" class="dropdown-item notify-item">
                    <div class="notify-icon bg-warning">
                        <i class="mdi mdi-account-plus"></i>
                    </div>
                    <p class="notify-details">
                        New user registered.
                        <small class="text-muted">5 hours ago</small>
                    </p>
                </a>-->

                <!-- item-->
                <!--<a href="javascript:void(0);" class="dropdown-item notify-item">
                    <div class="notify-icon bg-info">
                        <i class="mdi mdi-comment-account-outline"></i>
                    </div>
                    <p class="notify-details">
                        Caleb Flakelar commented on Admin
                        <small class="text-muted">4 days ago</small>
                    </p>
                </a>-->

                <!-- item-->
                <!--<a href="javascript:void(0);" class="dropdown-item notify-item">
                    <div class="notify-icon bg-secondary">
                        <i class="mdi mdi-heart"></i>
                    </div>
                    <p class="notify-details">
                        Carlos Crouch liked
                        <b>Admin</b>
                        <small class="text-muted">13 days ago</small>
                    </p>
                </a>
            </div>-->

            <!-- All-->
            <!--<a href="javascript:void(0);" class="dropdown-item text-center text-primary notify-item notify-all">
                浏览全部
                <i class="fi-arrow-right"></i>
            </a>

        </div>-->
    </li>

    <li class="dropdown notification-list">
        <a class="nav-link dropdown-toggle nav-user mr-0 waves-effect waves-light" data-toggle="dropdown" href="layouts-preloader.html#" role="button" aria-haspopup="false" aria-expanded="false">
            <img src="/assets/images/users/user-1.png" alt="user-image" class="rounded-circle">
            <span class="pro-user-name ml-1">
                @appUser.UserName <i class="mdi mdi-chevron-down"></i>
            </span>
        </a>
        <div class="dropdown-menu dropdown-menu-right profile-dropdown ">
            <!-- item-->
            <div class="dropdown-header noti-title">
                <h6 class="text-overflow m-0">欢迎 !</h6>
            </div>

            <!-- item-->
            <a href="~/Profile/Index"  class="dropdown-item notify-item">
                <i class="fe-user"></i>
                <span>我的资料</span>
            </a>

            <!-- item-->
            @*<a href="javascript:void(0);" class="dropdown-item notify-item">
                    <i class="fe-settings"></i>
                    <span>Settings</span>
                </a>*@

            <!-- item-->
            @*<a href="javascript:void(0);" class="dropdown-item notify-item">
                    <i class="fe-lock"></i>
                    <span>Lock Screen</span>
                </a>*@

            <div class="dropdown-divider"></div>
            <form asp-area="" asp-controller="Account" asp-action="Logout" method="post" id="logoutForm">
                <!-- item-->
                <button type="submit" class="dropdown-item notify-item">
                    <i class="fe-log-out"></i>

                    <span>退出</span>
                </button>
            </form>
        </div>
    </li>

    <script>
        function showmine(uid) {
            // 到后端，获取个人的基本信息

        }
    </script>
    @*<li class="dropdown notification-list">
            <a href="javascript:void(0);" class="nav-link right-bar-toggle waves-effect waves-light">
                <i class="fe-settings noti-icon"></i>
            </a>
        </li>*@

    @*<li class="dropdown user user-menu">
            <form asp-area="" asp-controller="Account" asp-action="Logout" method="post" id="logoutForm">

                <div class="pull-right">
                    <button type="submit" style="background-color: #3c8dbc;margin-top:10px;margin-right:20px;color:#fff" class="btn btn-default btn-flat">退出</button>
                </div>

            </form>

        </li>*@


}

